//管理员
const Sequelize = require('sequelize')
const { mySequelize } = require('../config/index')

const Admin = mySequelize.define('admin', {
    admin_id: {
        type: Sequelize.INTEGER(11),
        allowNull: false,
        primaryKey: true,
        autoIncrement: true,
    },
    account: {
        type: Sequelize.STRING,
        allowNull: true,
        unique: true,
    },
    password: {
        type: Sequelize.STRING,
        allowNull: true,
    },
    name: {
        type: Sequelize.STRING,
        allowNull: false,
    },
    sex: {
        type: Sequelize.INTEGER,
        allowNull: true,
    },
    work_num: {
        type: Sequelize.STRING,
        allowNull: false,
    },
    qq: {
        type: Sequelize.INTEGER,
        allowNull: true,
    },
    phone_num: {
        type: Sequelize.INTEGER,
        allowNull: true,
    },
    status: {
        type: Sequelize.INTEGER,
        allowNull: true,
        comment: "0-在线,1-离线",
    },
    log_time: {
        type: Sequelize.DATE,
        allowNull: true,
    }
}, {
    freezeTableName: true,
    timestamps: false,
    tableName: 'admin',
})

module.exports = Admin